///////////////////////////////////////////////////////////////////////////////////////
//
//	Say Password
//		- Version 1.0
//		- 01.16.2008
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
//	- Requested by MRosser1901
//
//	- Type "password" in the chat to see the server's current password
//
//////////////////////////////////////////////////////////////////////////////////
//
// Change Log:
//
//	- 01.16.08 - Version 1.0
//		Initial Release	
//
///////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////
// Module Includes
//
#include <amxmodx>


#define VERSION "1.0"
#define SVERSION "v1.0 - by diamond-optic (www.AvaMods.com)"

/////////////////////////////////////////////////
// PCVAR variables
//
new p_password

/////////////////////////////////////////////////
// Plugin Initialization
//
public plugin_init()
{
	register_plugin("Say Password",VERSION,"diamond-optic")
	register_cvar("amx_saypassword_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)
	
	register_clcmd("say password","sayPassword",0,"- displays server password")
	register_clcmd("say_team password","sayPassword",0,"- displays server password")
	
	p_password = get_cvar_pointer("sv_password")
}

public sayPassword(id)
{
	static password[64]
	get_pcvar_string(p_password,password,63)

	if(strlen(password))
		client_print(id,print_chat,"* current server password: %s",password)
	else
		client_print(id,print_chat,"* there is currently no password in use *")
	
	return PLUGIN_CONTINUE
}
